package com.darker.yygh.common;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

@Component
public class MyMetaObjecthandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
//        metaObject.setValue("create_time", LocalDateTime.now());
//        metaObject.setValue("update_time", LocalDateTime.now());
        metaObject.setValue("status",1);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        metaObject.setValue("create_time", LocalDateTime.now());
        metaObject.setValue("update_time", LocalDateTime.now());
    }
}
